#ifndef FORM_TF_H
#define FORM_TF_H

#include <QWidget>
#include <QSqlQuery>
#include <QMap>
#include <QSqlQueryModel>
#include <QListWidgetItem>
#include "threadyb.h"
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkInterface>
#include <QNetworkRequest>
#include <QJsonObject>
#include <QJsonArray>

namespace Ui {
class Form_tf;
}

class Form_tf : public QWidget
{
    Q_OBJECT

public:
    explicit Form_tf(QWidget *parent = nullptr);
    ~Form_tf();
    bool ghtp();
    bool fptp();
    bool saveSI();   //保存医保相关记录， fin_ipr_siinmaininfo
    bool getToken();
    void putBaseIn( QJsonObject &in, QString code);

private slots:
    void closeEvent(QCloseEvent *event);
    void resizeEvent(QResizeEvent *event);
    void on_pbSearch_clicked();
    void on_pbExecute_clicked();
    void on_pbExit_clicked();
    void on_leFph_returnPressed();
    //void postRequestFinished(QNetworkReply *);
    void postRequestFinished(QNetworkReply *);

private:
    Ui::Form_tf *ui;
    QSqlQuery *qrm, *qro;
    QString sq;
    //QString regRowid, regClinicCode, regPact;   //挂号主表rowid, clinic_code, 挂号方式。 退号时需要。
    QMap<QString, QString> mpPerson;    //患者个人资料
    //QString ybToken, ybMode;    //交易令牌，医保模式 ，“card” ：读卡， “code” ： 扫码， “id” ， 身份证
    QSqlQueryModel mdList ;  //项目明细列表
    QString msgid2208;

    volatile bool httpFinished; //http结束
    bool httpSuccess;   //http成功

    //QNetworkReply * rpl ;
    //QNetworkRequest request;

    QJsonObject ret2208setlinfo;
    QJsonObject ret2208setldetail;

    QString setl_id;
};

#endif // FORM_TF_H
